/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package CastleDefense;

import CastleDefense.Managers.GameManager;
import CastleDefense.units.Unit;
import java.awt.Image;
import javax.swing.ImageIcon;
import javax.vecmath.Vector2d;

/**
 *
 * @author Administrator
 */
public class AttachedUnit extends Actor
{
    private Image  sprite;

    public AttachedUnit(Vector2d loc, Unit unit)
    {
       super(loc);

       this.sprite = new ImageIcon(this.getClass().getResource(GameManager.getInstance().UNITS_PATH() + unit.getSpriteClean())).getImage();
       this.setName(unit.getName());
       this.setImage(sprite);
    }
    
    public boolean isGroundTrap()
    {
        return (this.getName().equals("Spikes") || this.getName().equals("Death Spikes") || this.getName().equals("TNT"));
    }
}
